#!/usr/bin/python3

import cv2

img = cv2.imread('/Users/ben/Documents/AI/CSDN/pics/lena.jpg', 0)
cv2.imshow('GRAY Source:', img)

# 为了让结果更清晰，这里的ksize设为3，
gray_lap = cv2.Laplacian(img, cv2.CV_16S, ksize=3)  # 拉式算子
dst = cv2.convertScaleAbs(gray_lap)
cv2.imshow('laplacian', dst)

img = cv2.imread('/Users/ben/Documents/AI/CSDN/pics/lena.jpg')
img_guassian = cv2.GaussianBlur(img, (5, 5), 0)
gray_lap = cv2.Laplacian(img, cv2.CV_16S, ksize=3)  # 拉式算子
dst = cv2.convertScaleAbs(gray_lap)
cv2.imshow('LoG', dst)

cv2.waitKey()
cv2.destroyAllWindows()